The present invention relates to the field of pulse generators. Specifically, embodiments of the present invention relate to a device for generating a stochastically modulated pulse train and method of same.
Various methods have been proposed to implement a digital-to-analog converter (DAC). One such method is to create a pulse train whose average value is equal to the magnitude of the digital input and then average the pulse train by passing it through a low-pass filter. Conventionally, pulse wave modulators (PWM) are used to create the pulse train from a digital input signal. However, the quality of the analog signal that results from the filtered pulse train may contain considerable noise unless an expensive low-pass filter is constructed.
FIG. 1A illustrates a single pulse 110 that may be part of a pulse train of a conventional PWM. The exemplary conventional PWM is a 256 state PWM with the pulse width set to 128. In particular, the pulse is high one-half the time and low one-half the time, for an average value of one-half. As another example, a pulse width of 64 will be low for 192 clock cycles and high for 64, for an average value of 0.25. The circuitry for the PWM itself is relatively simple. Constructing the pulse train comprises flipping the output between low to high after a number of counts occur, as the horizontal axis shows.
However, due to the nature of the pulse train, the pulse 110 of the PWM has considerable energy at low harmonics, which are difficult to filter out. FIG. 1B illustrates harmonic content of the PWM pulse of FIG. 1A for lower harmonics. The desired signal (zeroeth harmonic 140) has a magnitude of 128 (arbitrary units). However, there is significant energy at the first, third, and fifth harmonics 141, 143, 145. In particular, the first harmonic 141 has a magnitude of nearly 100 and the third and fifth harmonics 143, 145 have a magnitude of considerably higher than ten. If the pulse 110 could be filtered in an ideal fashion to remove all harmonic content, then the analog output would accurately track the digital input. However, building such a low-pass filter to remove all harmonic content is not practical and building a low-pass filter to remove most of the harmonic content is expensive.
Referring now to FIG. 2, if a conventional PWM generated pulse train 210 is processed with a low-pass filter 220 with a moderate roll-off, the analog output 230 will contain considerable noise due to the harmonics that are not completely filtered. Alternatively, a more expensive low-pass filter 220 (e.g., one with additional poles) may be constructed. However, this adds to the expense of the circuit and will still leave some harmonic energy. The extra poles will also slow the signal response. As the analog output 230 tends to track the average value of the PWM pulse train 210, the analog output 230 will have a delay when responding to changes in the average value of the PWM pulse train 210. This, of course, means that the analog output 230 will respond slowly to changes in value of the digital input signal. This will clearly be very detrimental it the analog output 230 is controlling a device, for example.
Thus, when implementing a DAC with a conventional PWM and low-pass filter 220, unless an expensive low-pass filler 220 is used, the analog output 230 will contain considerable harmonic energy (e.g., noise). Even a relatively expensive low-pass filter 220 will not totally remove the harmonic content. Furthermore, additional poles that are required to remove harmonic content may slow the signal response undesirably.
A second method of implementing a DAC is a delta-sigma modulator. A delta sigma modulator translates a binary value into a pulse train with a duty cycle that is proportional to the binary input. The pulse train is fed into a low-pass filter 220 to obtain the analog signal. Due to the nature of the delta-sigma modulator, its pulse train has better characteristics to filter then a PWM""s pulse train 210. For example, its harmonic content is not as difficult to filter. Thus, the quality of its analog signal is better than the quality of the analog signal produced by most PWMs. However, a delta sigma modulator is expensive as it requires substantially. more hardware than a PWM. For example, a first order delta-sigma modulator may require an adder at the input, an integrator, and a quantizer that produces the pulse train of zeroes and ones. To provide better results, delta-sigma modulators are commonly second order, requiring an additional stage having another adder and an accumulator or integrator.
Furthermore, there are applications such as dithering in which it is desirable to add a first signal into a second signal to improve the second signal or to increase its effective resolution. However, some conventional dithering techniques, such as adding a sine wave to the input of an analog-to-digital converter to increase its resolution, add frequency content at the frequency of the dithering signal.
Therefore, it would be advantageous to provide a DAC that is relatively inexpensive. It would also be advantageous to provide a DAC that has a high quality analog signal. It would also be advantageous to provide a DAC that produces a higher quality analog signal than a typical PWM DAC without the expense of a delta sigma modulator DAC. It would also be advantageous to provide a DAC whose response is not slowed by a low-pass filter with many poles, while providing a relatively simple circuit. It would be further advantageous to provide a device that may be used for applications such as dithering without inputting undesirable harmonic content.
Embodiments of the present invention provide a stochastically modulated pulse generator. In one embodiment, the pulse generator is used to implement a DAC. Embodiments of the present invention provide a DAC that produces a higher quality analog signal than a typical PWM DAC without the expense of a delta sigma modulator DAC. Embodiments of the present invention provide a device that may be used for dithering without injecting substantial undesired harmonic content. Embodiments of the present invention provide these advantages and others not specifically mentioned above but described in the sections to follow.
A pulse generator is disclosed. In one embodiment, the pulse generator may comprise a pseudo random number generator, a comparator coupled to the pseudo random number generator, and a register coupled to the comparator. The comparator may perform comparisons of values generated by the pseudo random number generator and a value in the register, wherein the comparator may output a pulse that is modulated according to the comparison.
In one embodiment, a low-pass filter may be coupled to the comparator output. Also, the register may receive samples of a digital signal. Implementing a DAC by filtering the comparator output may be less expensive than conventional delta-sigma modulator DACs and may have better performance than conventional PWM DACs.
Another embodiment provides for a method of generating a stochastically modulated pulse. The method may comprise loading a value into a register, and generating a series of pseudo random numbers. The register value may be compared to the pseudo random numbers. The results of the comparisons may be output. In this fashion, the register value may be modulated by the pseudo random numbers to produce a stochastically modulated pulse train.
In one embodiment, in addition to the steps of the previous paragraph, samples of a digital signal may be fed into the register and the output of the comparator may be low-pass filtered. In this fashion, the pulse generator may implement a stochastically modulated DAC.